import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingDeque;

class MyThreadPool{
    BlockingQueue<Runnable> blockingQueue=new LinkedBlockingDeque<>();
    public void submit(Runnable runnable) throws InterruptedException {
        blockingQueue.put(runnable);
    }
    public MyThreadPool(int n){
        for (int i = 0; i < n; i++) {
            Thread t = new Thread(() -> {
                try {

                    while (true) {
                        Runnable take = blockingQueue.take();
                        take.run();
                    }

                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            });
            t.start();
        }

    }
}
public class test8 {
    public static void main(String[] args) {
        int i,a=7,flog=0;
        for(i=2;i<(a/2);i++){
            if(a%i==0){
                flog=1;
                break;
            }
            if(flog==0&&i!=2){
                System.out.println(a+"是素数");
            }else{
                System.out.println(a+"不是素数");
            }
        }
    }
//    public static void main(String[] args) {
//        int sum=0;
//        for (int i = 1; i <=100 ; i++) {
//            if (i/10%10==9){
//
//                sum++;
//            }
//
//            if (i%10==9){
//                sum++;
//            }
//        }
//        System.out.println("1—100之间9出现的次数："+sum);
//    }








//    public static void main(String[] args) throws InterruptedException {
//        MyThreadPool pool=new MyThreadPool(10);
//        for(int i=0;i<1000;i++) {
//            int number=i;
//            pool.submit(new Runnable() {
//                @Override
//                public void run() {
//                    System.out.println("hello "+number);
//                }
//            });
//        }
//    }
}
